package com.syq.controller;

import com.alibaba.fastjson.JSON;
import com.syq.entity.GoodsType;
import com.syq.service.GoodsTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.management.DynamicMBean;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author wgy
 * @version V1.0
 * @project gp12_xiaomi
 * @package ${PACKAGE_NAME}
 * @description: ${TODO}
 * @date 2022/6/23 10:05
 */

@Controller
@RequestMapping("/goodstype")
public class GoodsTypeServlet  {

    @Autowired
    private  GoodsTypeService goodsTypeService;



    @GetMapping("/goodstype")
    public List<GoodsType> goodstypelist( GoodsType goodsType, HttpServletResponse response) throws Exception{
        List<GoodsType> list=null;
        if(goodsType==null) {
            System.out.println("查询数据库...");
            //获取商品类别
            //1创建业务对象

            //2调用方法
             list = goodsTypeService.findByLevel(1);

        }

        return null;
    }


}
